<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/assets/vendor/bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" href="/assets/vendor/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/assets/vendor/adminlte/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/assets/vendor/adminlte/css/skins/skin-blue.min.css">
    <link rel="stylesheet" href="/assets/vendor/layer/theme/default/layer.css">
    <!--表单校验-->
    <link rel="stylesheet" href="/assets/vendor/bootstrapvalidator/css/bootstrapValidator.min.css"/>
    <link rel="stylesheet" href="/assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css">
    <style>

    </style>
    <#--自定义加载css-->
    ${css!}
    <!--[if lt IE 9]>
    <![endif]-->
</head>
<script src="/assets/vendor/html5shiv.min.js"></script>
<script src="/assets/vendor/respond.min.js"></script>
<script src="/assets/vendor/jquery/jquery.min.js"></script>
<script src="/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="/assets/vendor/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="/assets/vendor/fastclick/fastclick.js"></script>
<script src="/assets/vendor/adminlte/js/adminlte.min.js"></script>
<!-- layer -->
<script src="/assets/vendor/layer/layer.js"></script>
<!--表单校验-->
<script src="/assets/vendor/bootstrapvalidator/js/bootstrapValidator.js"></script>
<script src="/assets/vendor/bootstrapvalidator/js/language/zh_CN.js"></script>

<script src="/assets/js/custom.js"></script>
<script src="/assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="/assets/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"
        charset="UTF-8"></script>
<script>
    //tableId,queryId,conditionContainer
    //var userTable;
    $(function () {
        //Date picker
        $('#datepicker').datepicker({
            autoclose: true,
            format: "yyyy-mm-dd",
            todayHighlight: true,
            language: "zh-CN"
        });
        $('#datepicker-end').datepicker({
            autoclose: true,
            format: "yyyy-mm-dd",
            todayHighlight: true,
            language: "zh-CN"
        });
        $('#datepicker').unbind("change");
        $('#datepicker').change(function () {
            $('#datepicker-end').datepicker('setStartDate', $("#datepicker").val());
        });
        $('#datepicker-end').unbind("change");
        $('#datepicker-end').change(function () {
            $('#datepicker').datepicker('setEndDate', $("#datepicker-end").val());
        });

        $('input[name="status"]').click(function () {
            $('#form').submit();
        })
        <#if errorMsg??>
        parent.layer.alert('${errorMsg}');
        </#if>
    });
</script>
<#--自定义加载js-->
${js!}
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<!-- Content Header (Page header) -->
<body class="skin-blue sidebar-mini">
<!-- Main content -->
<section class="content">
    <!-- Default box -->
    <div class="box box-primary">
        <div class="box-header">
            <form class="form-horizontal form-edit" method="get" action="/agent/agentOrderInner" id="form">
                <input type="hidden" name="agentId" value="${orderReq.agentId!}">
                <div class="form-group">
                    <div class="col-sm-12">
                        <div class="input-group">
                            <label>业务类型：</label>
                            <input type="radio" name="tranType" id="tranType_all" value=""
                                   <#if orderReq.tranType == ''>checked="checked"</#if>>
                            <label for="tranType_all" style="margin-left: 5px;margin-right: 5px">全部</label>
                            <input type="radio" name="tranType" id="tranType_paotui" value="1"
                                   <#if orderReq.tranType == '1'>checked="checked"</#if>>
                            <label for="tranType_paotui" style="margin-left: 5px;margin-right: 5px">跑腿</label>
                            <input type="radio" name="tranType" id="tranType_other" value="2"
                                   <#if orderReq.tranType == '2'>checked="checked"</#if>>
                            <label for="tranType_other" style="margin-left: 5px;margin-right: 5px">其他</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2">
                        <div class="input-group date">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" placeholder="开始日期" name="startTime" class="form-control pull-right"
                                   id="datepicker" value="${orderReq.startTime!}">
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group date">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" placeholder="结束日期" name="endTime" class="form-control pull-right"
                                   id="datepicker-end" value="${orderReq.endTime!}">
                        </div>
                    </div>

                    <div class="btn-group">
                        <button type="submit" class="btn btn-primary" data-btn-type="search">查询</button>
                        <button type="button" class="btn btn-default" data-btn-type="reset"
                                onclick="javascript:$('#form')[0].reset();">重置
                        </button>
                        <a class="btn btn-success"
                           href="/agent/agentOrderExport?agentId=${orderReq.agentId!}&startTime=${orderReq.startTime!}&endTime=${orderReq.endTime!}&tranType=${orderReq.tranType!}">导出</a>
                    </div>
                </div>
            </form>
        </div>
        <div class="box-body">
            <table class="table table-striped bring-up nth-2-center">
                <tr>
                    <th>账单总额</th>
                    <th>平台收益</th>
                    <th>分站收益</th>
                    <th>师傅收益</th>
                    <th>有效单数</th>
                    <th>取消单数</th>
                </tr>
                <tr>
                    <td>${collect.total_order_amount?string('0.00')!}</td>
                    <td>${collect.platform?string('0.00')!}</td>
                    <td>${collect.agent?string('0.00')!}</td>
                    <td>${collect.master?string('0.00')!}</td>
                    <td>${collect.valid_count!}</td>
                    <td>${collect.invalid_count!}</td>
                </tr>
            </table>
            <table class="table table-striped">
                <tr>
                    <th>日期</th>
                    <th>业务类型</th>
                    <th>平台收益</th>
                    <th>分站收益</th>
                    <th>师傅收益</th>
                    <th>优惠款</th>
                    <th>有效单数</th>
                    <th>取消单数</th>
                </tr>
                <#list agentOrderList as item>
                    <tr>
                        <td>${(item.tranTime?string('yyyy-MM-dd'))!}</td>
                        <td>${item.tranType!}</td>
                        <td>${item.platformIncome?string('0.00')!}</td>
                        <td>${item.agentIncome?string('0.00')!}</td>
                        <td>${item.masterIncome?string('0.00')!}</td>
                        <td>${item.offer!}</td>
                        <td>${item.validCount!}</td>
                        <td>${item.invalidCount!}</td>
                    </tr>
                </#list>
            </table>
        </div>
    </div>
    <!-- /.box -->

</section>
<!-- /.content -->
</body>
</html>
